﻿using System;
using System.Configuration;
using System.ServiceModel;
using System.ServiceModel.Syndication;

namespace NCMIS.ObjectModel.Rest
{
    /// <summary>
    /// Holds commong elements for the CMIS REST/Atom binding.
    /// </summary>
    public class CmisRestAtom
    {
        public static int DefaultMaxItems = 20;

        // The Base URI for REST/Atom services.
        public static readonly Uri ServiceBaseUri = new Uri(ConfigurationManager.AppSettings["RaServiceBaseUri"]);

        // Sample (local)  server service URI
        //public static readonly Uri ServiceUri = new Uri(String.Format("{0}{1}", ConfigurationManager.AppSettings["RaServiceBaseUri"], "Service.svc/"));
        
        // Alfresco CMIS repository service URI
        public static readonly Uri ServiceUri = new Uri(String.Format("{0}{1}", ConfigurationManager.AppSettings["RaServiceBaseUri"], "/service/cmis/"));

        /// <summary>
        /// Returns default author for Atom enteties (entries, feeds, etc).
        /// </summary>
        public static SyndicationPerson Author
        {
            // TODO: Insert {cmis:createdBy}
            get { return new SyndicationPerson("dennis.nkangi@episerver.com", "Dennis Nkangi", "http://www.episerver.com/"); }
        }
    }
}
